/**
 * Customer.js
 *
 * @description :: TODO: You might write a short summary of how this model works and what it represents here.
 * @docs        :: http://sailsjs.org/documentation/concepts/models-and-orm/models
 */
const uuid = require('node-uuid');
function generate_id() {
  var id = uuid.v4();
  return id.replace(/-/g, "");
}

module.exports = {

  tableName: 'customer',

  attributes: {
    id: {
      type: 'string',
      primary: true,
      required: true,
      defaultsTo: generate_id()
    },
    card_no: {
      type: 'string',
      columnName: 'card_no'
    },
    name: {
      type: 'string',
      columnName: 'name'
    },
    gender: {
      type: 'string',
      columnName: 'gender'
    },
    age: {
      type: 'string',
      columnName: 'age'
    },
    phone: {
      type: 'string',
      columnName: 'phone'
    },
    point_avail: {
      type: 'string',
      columnName: 'point_avail'
    },
    remark: {
      type: 'string',
      columnName: 'remark'
    }
  }
};

